/**
*      author: Y_Yao
*      created: 2024-11-16 18:41:49
**/

#include<bits/stdc++.h>

using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 100 + 7;
int n,k;
string s;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> k;
    cin >> s;

    int ret = 0;
    for(int i = 0;i < s.size();i++)
    {
        if(s[i] == 'X') continue;
        else
        {
            int flag = 0;
            for(int j = 1;j < k;j++)
            {
                if(s[i + j] != 'O')
                {
                    flag = 1;
                    break;
                }
            }
            if(flag == 0)
            {
                ret++;
                i = i + k;
                i--;
            }
        }
    }
    cout << ret << endl;
    return 0;
}